TM Micro Service API Prototype class
This class provide fetch wrapper, token and Service URL setter mainly. Just to avoid code duplication.
Requirements
Possibly you will need babel-polyfill to use it.
Documentation
Table of Contents
ErrorBadRequest
Custom error message for Bad Request server response
Parameters
message
(string | null) error details (optional, default null
)
ErrorCache
Custom error message for cache fail
Parameters
message
(string | null) error details (optional, default null
)
ErrorNotFound
Custom error message for Not Found server response
Parameters
message
(string | null) error details (optional, default null
)
ErrorServerResponse
Custom error message for abstract server response
Parameters
statusCode
number http status codestatusText
string http status code textmessage
(string | null) error details (optional, default null
)
MicroServiceAPI
TM Micro Service Proto API
Parameters
url
string service urltoken
(string | null) user access tocken if available (optional, default null
)
url
Service URL
Properties
token
User access token
Properties
token
(string | null)? user access tocken if available
messages
Object with class service messages
Type: Object
setToken
Set access token
Parameters
setVersion
Set service version
Parameters
version
string service version
checkVersion
Validate service version
Parameters
Returns string version - service version
request
Fetch remote resource
Parameters
url
string resource urluserOptions
Object user defined options
Returns Promise Promise with server Response
tmpVersion
Service version
Properties
version
string? service version